package cn.wolfcode.shop.api.domain;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

@Getter
@Setter
public class Brand extends BaseDomain   {

    @JsonFormat(pattern = "yyyy-MM-dd" ,timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd" )
    private Date createdDate;

    @JsonFormat(pattern = "yyyy-MM-dd" ,timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd" )
    private Date lastModifiedDate;
    private Integer version;
    private Date foundDate;
    private String logo;  //品牌log路径
    private String chineseName;
    private String englishName;
    private String description;
    private String url;
    private Integer sequence;
    private Long mods;  //是否显示的状态值 1 显示, 0不显示
    private String  brandCatalogs;  //品牌分类
    private String  underProducts;  //旗下商品


    //页面数据回显--使用data-json='${info.jsonString}' 自定义属性的选择器 组好是类选择器
    public String getJsonString() {
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("id", id);
        map.put("createdDate", createdDate);
        map.put("lastModifiedDate", lastModifiedDate);
        map.put("chineseName", chineseName);
        map.put("englishName", englishName);
        map.put("description", description);
        map.put("url", url);
        map.put("version", version);
        map.put("logo", logo);
        map.put("sequence", sequence);
        map.put("mods", mods);
        map.put("brandCatalogs", brandCatalogs);
        map.put("underProducts", underProducts);
        //将map转为json数据: 需要加入fastjson包. 将map集合转为json格式数据, 便于前台接收显示
        return JSON.toJSONString(map);

    }




}